Skip to content

Add the local plan-indexed review screen - #9

Merged
mchwang merged 8 commits into
mainfrom
codex/read-only-review
Sep 23, 2026
Merged

mchwang merged 8 commits into
mainfrom
codex/read-only-review

Conversation

@mchwang

@mchwang mchwang commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Adds a local review application on top of the plan/linking library and SQLite store. npm run demo starts a loopback-only screen backed by a real Git fixture; an existing trusted store can be opened with npm start -- --config review.json.

The screen groups changes by plan item, shows attribution/scope/tests/AI-review status, renders provenance and file metadata, persists approvals and per-item discussion, supports assignment/acceptance and no-change confirmation, and shows stale approval evidence. Refresh observes HEAD changes. Browser actions are bound to the reviewed state and an atomic review counter, so concurrent assignments cannot silently be approved from an old view. Store schema v2 transactionally migrates v1 data.

Uses DESIGN.md tokens and self-hosted Plex fonts, keyboard navigation, desktop breakpoints, and error/empty states. The HTTP boundary is loopback-only with a private token, origin/host validation, bounded UTF-8 JSON, CSP, and escaped untrusted text. No merge, agent execution, or test execution controls are included. Questions are saved rather than falsely presented as AI-answered; unavailable check evidence is labeled Not run.

Also adds a disposable-clone planting helper with ledger-aware SHA mappings and a committed experiment protocol. The source repository is unchanged by planting. Real issue pairs, the manual assignment, human timed reviews, and the final go/no-go result are pending. Raster previews and byte sizes are included; unsupported/oversized previews are labeled unavailable. This advances #3 but does not close it or claim the go/no-go gate passed.

Validation: 174 unit/integration tests (baseline 157), 13 Playwright tests, typecheck, and diff formatting pass. Chromium coverage includes persistent approvals/notes, assignment staleness, metadata, no-change confirmation, keyboard/breakpoints, stale-view rejection, origin/auth checks, history errors, untrusted text, large-change assignments, and decoded image previews. Visually inspected the desktop screenshot. CI now runs the browser suite.

Decisions, local setup, remaining work: docs/implementation/read-only-review.md. Experiment protocol: docs/experiments/review-protocol.md.

Boundary fixes before final review: a 20 KB assignment reproduced HTTP 413, fixed with opaque segment IDs while preserving stored content/copy keys. Raster previews are limited to 1 MiB per blob, 4 MiB raw across history, and 6 MiB encoded per response. Non-ASCII paths on case-insensitive filesystems fail explicitly until a filesystem-specific identity adapter is supplied.

Review round 1: reproduced and fixed no-change approval with unresolved ambiguity, malformed credential status handling, and stale controls after errors. Added standalone-acceptance persistence and whole-plan empty-state coverage. Browser assets are authored source (formatted and marked as such), not generated output. No findings declined.

Review round 2: reproduced mixed owned/ambiguous approval succeeding, then fixed the runner guard and UI routing for every ambiguous item. The guard now applies regardless of owned-change count. No findings declined.

Review round 3: reproduced and fixed demo config/symlink escapes and inherited Git environment redirection. Demo and planting commands now share a case-insensitive Git environment scrub; four helper regressions exercise these boundaries. Also reproduced and fixed keyboard shortcuts becoming inactive when toolbar buttons have focus. No findings declined.

Review round 4: no inline findings; addressed both summary concerns with reproduced regressions. Planting applies the viewer’s non-ASCII case-insensitive path guard, and accepted cards explicitly say “Accepted outside plan” while retaining provenance. No concerns declined.

Review round 5: reproduced and fixed symlinked demo ancestors and canonical filename collisions. Planting checks declared paths plus base/commit tree paths through the configured identity before cloning. No actionable findings declined; the summary also mentioned status styling without a concrete example (accepted-row labeling was fixed in round 4).

Review round 6: fixed a reproduced destination-inside-source boundary violation, including canonical symlink aliases. Declined the Git-environment claim: the wrapper already passes env, and a new end-to-end inherited-variable test passed before production changes. The unspecified snapshot-race summary is guarded by view consistency checks and atomic write CAS with concurrent-write tests.

Review round 7: fixed reproduced oversized image dimensions and dangling SQLite sidecar links. Preview metadata must meet per-side (8192), per-image (4M pixels) and cumulative unique-blob (16M pixels) limits as well as byte limits. Unknown dimensions omit the preview. Both actionable findings addressed.

Final review status: eight automated review rounds; the final round on e582882 reported no new findings. All ten concrete review threads are resolved. One environment-passing false positive was declined with passing end-to-end evidence. Summary-only rename/literal-path/styling concerns are preserved for targeted validation in #10. Both CI runs, typecheck, 174 unit/integration tests and 13 browser tests pass. User authorized merging. Issue #3 remains open for the real-issue experiment.

Copilot AI lite review requested due to automatic review settings September 23, 2026 15:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Unresolved findings affect no-change approval safety, stale/error handling, token validation, and acceptance-path coverage.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
What changed in this PR

Adds a loopback-only, plan-indexed review application backed by Git and SQLite, with persistent review state, browser coverage, and experiment tooling.

Changes:

  • Added review server, CLI, responsive UI, authentication, and persistence.
  • Added approvals, notes, assignments, stale-state handling, and schema migration.
  • Added demo/planting tools, Playwright tests, CI integration, and documentation.
File Summary
web/​server.ts Loopback HTTP server and authenticated API boundary
web/​public/​style.css Review screen styling and responsive layout
web/​public/​index.html Review application structure
web/​public/​app.js Browser rendering and review interactions
web/​cli.ts Demo and configured-store CLI
vitest.config.ts Vitest configuration
tsconfig.json Expanded TypeScript coverage
test/​review.test.ts Review persistence and concurrency tests
test/​plant.test.ts Planting behavior tests
test/​browser/​review.spec.ts Playwright UI coverage
scripts/​plant.ts Disposable experiment planting helper
scripts/​demo.ts Demo repository and store fixture
runner/​store.ts Review persistence and schema migration
runner/​review.ts Review loading, actions, and stale-state handling
README.md Updated project status and usage
playwright.config.ts Browser test configuration
package.json Runtime, test, and browser scripts/dependencies
package-lock.json Dependency lockfile updates
docs/​implementation/​read-only-review.md Review implementation guide
docs/​experiments/​review-protocol.md Go/no-go experiment protocol
.gitignore Local and test artifact exclusions
.github/​workflows/​ci.yml Browser test CI integration
Files not reviewed (2)
  • web/public/app.js: Generated file
  • web/public/style.css: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread web/public/app.js Outdated
Copilot AI review requested due to automatic review settings September 23, 2026 16:01
@mchwang

mchwang commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

Round 1 response: fixed the no-change/ambiguity bypass, malformed-token handling, and stale/error control state with failing-before/passing-after regressions. Added standalone acceptance persistence and whole-plan empty-state browser coverage. No findings declined.

The update also completes bounded raster previews/byte sizes and fixes large-change assignment commands via opaque IDs (20 KB regression first returned HTTP 413). The hand-authored JS/CSS/HTML are formatted and explicitly marked as authored source; please include them in review rather than treating them as generated files.

Validation on 19aabad: 163 unit/integration tests, 11 browser tests, typecheck, and diff checks pass. Requesting a fresh review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Approval must reject unresolved ambiguous attribution, and the UI must route all such items to resolution before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
Resolved since last review (1)

Comment thread runner/review.ts Outdated
Copilot AI review requested due to automatic review settings September 23, 2026 16:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Seven unresolved review findings remain, including critical demo/planting isolation issues.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 3 High severity

Open (3)
Resolved since last review (1)

Comment thread scripts/demo.ts Outdated
Comment thread scripts/demo.ts Outdated
Comment thread scripts/plant.ts Outdated
Copilot AI review requested due to automatic review settings September 23, 2026 16:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Address the non-ASCII path guard in scripts/plant.ts and normalize accepted-row scope metadata in web/public/app.js.

Review effort: Lite
Findings: None

Resolved since last review (3)

Copilot AI review requested due to automatic review settings September 23, 2026 16:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Unresolved demo fixture boundary and planting path-identity issues remain, along with review UI status styling corrections.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
Previously missed (2)

In code that hasn't changed since last review

Medium severity Compare canonical paths for case-insensitive collision checks

scripts/​plant.ts:28

This collision check compares raw spellings even though pathKey is explicitly configured for case-insensitive filesystems. With a declared retry.ts and an input path RETRY.TS, planting proceeds and the viewer canonicalizes both paths to the same identity, so the supposedly undeclared plant is classified in-scope. Compare canonical pathKey values before creating the clone.

Medium severity Detect existing paths using configured case-insensitive identity

scripts/​plant.ts:46

The existing-path guard also uses an exact Git pathspec, so on a case-sensitive source checkout configured with caseSensitive: false, an existing FOO.TXT is not detected when the requested plant is foo.txt. The clone can then create an identity alias that the linking layer treats as the same path, invalidating the experiment's out-of-scope classification. Enumerate the relevant tree paths and compare them through the configured identity function (including the base tree), rather than checking only the exact spelling.

Comment thread scripts/demo.ts
Copilot AI review requested due to automatic review settings September 23, 2026 16:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Unresolved planting-boundary safety issues and a concurrent review snapshot race remain.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 High severity

Open (2)
Resolved since last review (1)

Comment thread scripts/plant.ts
Comment thread scripts/plant.ts
Copilot AI review requested due to automatic review settings September 23, 2026 16:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Unresolved critical preview and demo-store safety findings, plus moderate rename-scope and literal-path validation findings, remain.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 High severity

Open (2)
Resolved since last review (2)

Comment thread git/history.ts Outdated
Comment thread scripts/demo.ts Outdated
Copilot AI review requested due to automatic review settings September 23, 2026 16:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Two moderate findings and one styling nit remain unresolved.

Review effort: Lite
Findings: None

Resolved since last review (2)

@mchwang
mchwang merged commit be268b9 into main Sep 23, 2026
3 checks passed
@mchwang
mchwang deleted the codex/read-only-review branch September 23, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants